Restore grouped project filtering in Sidebar V2#4282
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR restores grouped project filtering functionality, significantly changing how projects are displayed, scoped, filtered, and deleted in the sidebar. The behavioral changes across multiple core operations warrant human review. You can customize Macroscope's approvability policy. Learn more. |
7f2ba9f to
1ff96af
Compare
1ff96af to
d64eeae
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
c0f0ff2 to
2e484a2
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ebb4fa0. Configure here.
Co-authored-by: codex <codex@users.noreply.github.com>

Why
Sidebar V2 treats environment-scoped copies of the same repository as separate projects. Users therefore see duplicate project entries and selecting one copy hides threads belonging to the other environment.
Root cause
Sidebar V2 filters directly by one physical environment/project pair instead of using the logical-project grouping already available to the legacy sidebar.
Fix
This PR is intentionally limited to Sidebar V2 filtering. New-thread pickers, settings, and mobile behavior are split into follow-up PRs.
Verification
vp linton the five changed web filesvp run --filter @t3tools/web typecheckvp test run apps/web/src/components/Sidebar.logic.test.ts apps/web/src/environmentGrouping.test.ts— 85 tests passedNote
Medium Risk
Changes sidebar scoping and bulk project deletion across environments; behavior is localized to Sidebar V2 with new unit tests but affects navigation and destructive actions.
Overview
Sidebar V2 no longer treats each environment-scoped project as its own filter row. It builds logical project snapshots, sorts them with
sortLogicalProjectsForSidebar(manual order vs recent activity across all member refs, ignoring archived threads), and scopes active/settled threads to everymemberProjectRefin the selected group.Grouping data changes:
buildSidebarProjectSnapshotsfillsmemberProjectRefsfrom the full project list (including stale duplicate physical entries routed to a logical group), not only display members.buildSidebarProjectPickerEntriesis added for one entry per logical group with preferred-environment targeting (covered by tests; wired for follow-ups per PR scope).The project filter menu, empty states, and remove project flow operate on groups—confirmation copy reflects multiple entries, and removal deletes all member projects and clears drafts. New thread treats a single logical group like a single project (
projectGroups.length). ManualprojectOrderis applied when building snapshots in manual sort mode.Reviewed by Cursor Bugbot for commit ee44f63. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore grouped project filtering in Sidebar V2 to operate on logical project groups
sortLogicalProjectsForSidebarin Sidebar.logic.ts to sort groups by recent activity across member threads, or respect manual order when configured.buildSidebarProjectPickerEntriesin sidebarProjectGrouping.ts to produce picker entries per logical group, with preferred-environment targeting.Macroscope summarized ee44f63.